import java.util.ArrayList;


public class Script {

	
	ArrayList<RulePiece> pieces;
	
	
	
	public Script(String info){
		pieces = new ArrayList<RulePiece>();
		
		String s1;
		String s2;
		
		
		//read script info (already processed by scannergenerator) thing by thing
		while(info.indexOf('\n')>0){
			s1 = info.substring(0, info.indexOf(' '));
			s2 = info.substring(info.indexOf(' ')+1, info.indexOf('\n'));
			
			addRulePiece(s1, s2);
			
			info = info.substring(info.indexOf('\n')+1);
		}
	}
	
	public void addRulePiece(String s1, String s2){
		
		addRulePiece(new RulePiece(s1,s2,0));
		
	}
	
	public void addRulePiece(RulePiece rp){
		pieces.add(rp);
	}
	
	
}
